﻿#pragma once

#include "MirImageControl.h"
#include "MirLabel.h"
#include "MirButton.h"
#include "MirTextBox.h"
#include <string>
#include <any>

using namespace Client::MirGraphics;

namespace Client::MirControls
{
    class MirInputBox final : public MirImageControl
    {
    public:
        MirLabel *const CaptionLabel;
        MirButton *const OKButton, *const CancelButton;
        MirTextBox *const InputTextBox;


        virtual ~MirInputBox()
        {
            delete CaptionLabel;
            delete OKButton;
            delete CancelButton;
            delete InputTextBox;
        }

        MirInputBox(const std::string &message);

    private:
        void MirInputBox_KeyPress(std::any sender, KeyPressEventArgs *e);
        void DisposeDialog(std::any sender, EventArgs *e);

    public:
        void OnKeyDown(KeyEventArgs *e) override;
        void OnKeyUp(KeyEventArgs *e) override;
        void OnKeyPress(KeyPressEventArgs *e) override;

        void Show() override;


        #pragma region Disposable

    protected:
        void Dispose(bool disposing) override;

        #pragma endregion

    };
}
